﻿<Page x:Name="page"
    x:Class="Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views.FullScreenPortrait.Projects"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
      d:Width="1024">
    <Page.TopAppBar>
        <AppBar>
            <StackPanel Orientation="Horizontal">
                <Button Command="{Binding GoToHome}" Content="Home" Style="{StaticResource AppBarTextButtonStyle}" FontSize="26.667" Margin="40,0,0,0"/>
            </StackPanel>
        </AppBar>
    </Page.TopAppBar>

    <FlipView Background="{StaticResource BackgroundBrush}" ItemsSource="{Binding ProjectCollection}" SelectedItem="{Binding SelectedProject,Mode=TwoWay}">
        <FlipView.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="120"/>
                        <RowDefinition Height="20"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="140"/>
                            <ColumnDefinition  Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Button Command="{Binding DataContext.GoBack, ElementName=page}" Grid.Column="0" Style="{StaticResource BackButtonStyle}" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        <TextBlock Grid.Column="1" Style="{StaticResource PageHeaderTextStyle}" Text="{Binding Name}" Margin="0" FontFamily="{StaticResource TitleFont}" Foreground="{StaticResource TitleBrush}" />
                    </Grid>
                    <Grid Grid.Row="2" Margin="120,0,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="600"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Image Grid.Row="0" Source="{Binding Image}" VerticalAlignment="Top" />
                        <TextBlock Grid.Row="2" Text="{Binding Description}" TextWrapping="Wrap" Style="{StaticResource BodyTextStyle}" Foreground="Black"/>
                        <ListBox Grid.Row="4" ItemsSource="{Binding Guidance}" Background="{x:Null}" BorderBrush="{x:Null}" ItemContainerStyle="{StaticResource ListBoxItemStyle}" Template="{StaticResource ListBoxControlTemplate}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="80"/>
                                            <ColumnDefinition Width="5"/>
                                            <ColumnDefinition Width="350"/>
                                            <ColumnDefinition Width="5"/>
                                            <ColumnDefinition Width="280"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Column="0" VerticalAlignment="Center" Text="{Binding GuidanceType}"/>
                                        <HyperlinkButton Grid.Column="2" VerticalAlignment="Center" NavigateUri="{Binding Url}" Foreground="Black" Style="{StaticResource HyperlinkButtonStyle}" RightTapped="HyperlinkButtonRightTapped">
                                            <TextBlock VerticalAlignment="Center">
                                                    <Run Text="Find jewel here: "/>
                                                    <Run Text="{Binding Url}"/>
                                            </TextBlock>
                                        </HyperlinkButton>
                                        <TextBlock Grid.Column="4" TextTrimming="WordEllipsis" VerticalAlignment="Center" Text="{Binding Originator}"/>
                                    </Grid>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </Grid>

            </DataTemplate>
        </FlipView.ItemTemplate>
    </FlipView>
</Page>